package com.kakaxi.mybilibili.module.search.model;

import com.kakaxi.mybilibili.common.WebUrlConst;
import com.kakaxi.mybilibili.net.Netroid;
import com.kakaxi.mybilibili.net.StringCacheRequest;
import com.kakaxi.mybilibili.utils.URLUtil;
import com.vincestyling.netroid.Listener;

import java.util.HashMap;
import java.util.Map;

/**
 * 搜索数据层实现类
 * Created by kakaxi on 16/11/24.
 */

public class SearchModel implements ISearchModel {


    @Override
    public void getSearchVideoData(String keyword, String page, Map<String, String> filterMap,
                                   Listener<String> listener) {
        Map<String, String> paramMap = new HashMap<>();
        paramMap.put("keyword", keyword);
        paramMap.put("page", page);
        String url = URLUtil.getURLWithParam(WebUrlConst.SEARCH_VIDEO_URL, paramMap);

        Netroid.addRequest(new StringCacheRequest(url, null, listener), true);
    }
}
